/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.gac.gacmod.palette;

import java.util.LinkedList;
import org.gac.gacmod.stepmanager.StepCategory;
import org.gac.gacmod.stepmanager.StepTypeWrapper;
import org.openide.nodes.Index;
import org.openide.nodes.Node;

/**
 *
 * @author Tomek
 */
public class StepNodeChildren extends Index.ArrayChildren{

    private StepCategory _category;

    public StepNodeChildren( StepCategory category )
    {
        _category = category;
    }

//    @Override
//    protected Node[] createNodes(Object arg0)
//    {
//        StepTypeWrapper wrapper = (StepTypeWrapper) arg0;
//        return new Node[]{ new StepNode( wrapper )};
//    }
//
//    @Override
//    protected void addNotify()
//    {
//        super.addNotify();
//        setKeys(_category.innerSteps());
//    }

    @Override
    protected java.util.List<Node> initCollection() {
        LinkedList<Node> nodes2 = new LinkedList<Node>();
        for( StepTypeWrapper stw: _category.innerSteps() )
            nodes2.add(new StepNode( stw ));
        return nodes2;
    }

}
